home *** CD-ROM | disk | FTP | other *** search
- /*
- SNEWS 2.0
-
- Snews - Bug Report Support
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 1, as
- published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- See the file COPYING, which contains a copy of the GNU General
- Public License.
-
- Ataru version ported by Graham Judd - gjudd@siward.demon.co.uk
-
- */
-
- /*---------------------------- Source Control ------------------------------*/
-
- /*
- * $Id: BUGREP.C,v 1.2 1994/02/05 18:46:56 gbj Exp user $
- */
-
- /****************************************************************************
- * 11 Sep 93 1.01 MSM Initial Version *
- * 26 Sep 93 1.02 MSM General improvements *
- * 2 Apr 94 1.03 MSM Input buffer extended *
- ****************************************************************************/
-
- #include "defs.h"
- #include "snews.h"
- #include "screen.h"
- #include "locking.h"
-
- #ifdef ATARI
- # include "fileops.h"
- #endif
-
- void ask(FILE *tmp, char *question);
- char answer(char *question, char *set);
- void clreos(void);
-
- /*------------------------------ Send a bug report ------------------------*/
- void bug_report()
- {
- int ans;
- char ch;
- FILE *tmp, *sig;
- int lct;
- WRK_FILE *wrk;
- char buf[80], sig_fn[65];
-
- clrscr();
- #ifdef ATARI
- if ((tmp = fopen("reply.tmp", "wt")) == NULL) {
- printf("Snews is unable to open the temporary file needed for mail\n");
- printf("Please check your setup.\n");
- printf("Press any key to return to Snews\n");
- ans = getch();
- return;
- }
- #else
- if ((tmp = fopen("reply.tmp", "wt")) == NULL) {
- printf("Snews is unable to open the temporary file needed for mail\n");
- printf("Please check your setup using DIS.EXE\n");
- printf("Press any key to return to Snews\n");
- ans = getch();
- return;
- }
- #endif
- gotoxy(20, 1);
- printf("Demon Internet Services - Problem Report.\n\n");
- printf("Do you wish to mail a problem report to the Internet Support Team\n");
- printf("at DEMON ? (y/n) ");
- ans = getch();
- putch(ans);
- putch('\n');
- putch('\n');
- ans = toupper(ans);
- if (ans != 'Y') {
- fclose(tmp);
- unlink("reply.tmp");
- return;
- }
- printf("Please complete the answers to as many of the following questions as you\n");
- printf("can. This will help the team to solve promptly the problem you are having.\n");
- printf("When you have answered a question, press <RETURN> on an empty line to proceed\n");
- printf("to the next question. After answering all the questions, you will be asked to\n");
- printf("confirm that you wish your problem to be sent.\n\n");
-
- sprintf(buf, "Bug report from %s.%s", my_stuff.my_site, my_stuff.my_domain);
-
- #ifndef ATARI
- if (make_header(tmp, buf, "internet@demon.net", NULL,
- NULL, &lct) != 0) {
- printf("Sorry, there is a problem writing to disk, please check your setup\n");
- printf("using DIS.EXE\n");
- printf("Press any key to return to Snews\n");
- ans = getch();
- fclose(tmp);
- unlink("reply.tmp");
- return;
- }
- #endif
-
- clreos();
- printf("Please choose one of the following categories:\n\n");
- printf(" 1 - General Problem.\n");
- printf(" 2 - Snews Problem.\n");
- printf(" 3 - KA9Q Problem.\n");
- printf(" 4 - PCElm Problem.\n");
- printf(" 5 - None of the above.\n\n");
- ch = answer("Please enter 1, 2, 3, 4 or 5 -", "12345");
-
- #ifdef ATARI
- if (ch == '2')
- {
- if (make_header(tmp, buf, "gjudd@siward.demon.co.uk", NULL,
- NULL, &lct) != 0) {
- printf("Sorry, there is a problem writing to disk, please check your setup.\n");
- printf("Press any key to return to Snews\n");
- ans = getch();
- fclose(tmp);
- unlink("reply.tmp");
- return;
- }
- }
- else
- {
- if (make_header(tmp, buf, "internet@demon.net", NULL,
- NULL, &lct) != 0) {
- printf("Sorry, there is a problem writing to disk, please check your setup.\n");
- printf("Press any key to return to Snews\n");
- ans = getch();
- fclose(tmp);
- unlink("reply.tmp");
- return;
- }
- }
- #endif
-
- fprintf(tmp, "Choice %c taken\n\n", ch);
- if (ch == '5')
- ch = '1';
- ask(tmp, "Please describe the problem:");
- if (ch == '1') {
- ask(tmp, "Please give the date and time it occurred:");
- ask(tmp, "What hardware are you using (e.g. PC Compatible, Macintosh) ?");
- ask(tmp, "What Operating System (e.g. MS-DOS 5.0, System 7.0) ?");
- ask(tmp, "What TCP/IP software (e.g. KA9Q 2.11, NET-mac) ?");
- ask(tmp, "Are you using SLIP or PPP ?");
- ask(tmp, "Which modem are you using ?");
- ask(tmp, "Is your modem internal or external ?");
- ask(tmp, "Are you using a buffered UART (16550) ?");
- ask(tmp, "Which Point of Presence were you logged in to ?");
- ask(tmp, "Which tty were you logged in to ?");
- ask(tmp, "Which program and version is giving the problem (e.g. Snews 1.23, pcelm 1.4) ?");
- if (answer("Are you using an IBM compatible (y/n) ?", "YN") == 'Y') {
- ask(tmp, "How much memory is free at the command.com prompt ?");
- ask(tmp, "Are you running directly from DOS or from a multitasker (e.g. Windows\nor DESQview) ?");
- }
- ask(tmp, "Have you read /pub/doc/Modem.txt ?");
- ask(tmp, "Have you read /pub/FAQ/support.faq ?");
- ask(tmp, "Have you read /pub/doc/ka9q/dispc.txt ?");
- }
- if (ch == '2') {
- fprintf(tmp, "2 - Snews Problem, %s (%02d.%02d.%02d)\n\n", VERSION, rmj, rmm, rup);
- #ifdef ATARI
- ask(tmp, "What version of TOS are you using ?");
- ask(tmp, "Are you running from the GEM Desktop, a replacement Desktop or a CLI ?");
- ask(tmp, "Are you running a multitasking operating system?");
- ask(tmp, "How much free memory do you have before running SNews?");
- #else
- ask(tmp, "What operating system (e.g. MS-DOS 5.0) ?");
- ask(tmp, "Are you running directly from DOS or from a multitasker (e.g. Windows\nor DESQview) ?");
- ask(tmp, "How much memory is free at the command.com prompt ?");
- #endif
- }
- if (ch == '3') {
- fprintf(tmp, "3 - KA9Q problem.\n");
- ask(tmp, "Which version of KA9Q (e.g. 2.11) ?");
- ask(tmp, "What Operating System (e.g. MS-DOS 5.0, System 7.0) ?");
- ask(tmp, "Are you running directly from DOS or from a multitasker (e.g. Windows\nor DESQview) ?");
- ask(tmp, "How much memory is free at the command.com prompt ?");
- ask(tmp, "Are you using SLIP or PPP ?");
- ask(tmp, "Which modem are you using ?");
- ask(tmp, "Is your modem internal or external ?");
- ask(tmp, "Are you using a buffered UART (16550) ?");
- ask(tmp, "Which Point of Presence were you logged in to ?");
- ask(tmp, "Which tty were you logged in to ?");
- ask(tmp, "Have you read /pub/doc/Modem.txt ?");
- ask(tmp, "Have you read /pub/FAQ/support.faq ?");
- ask(tmp, "Have you read /pub/doc/ka9q/dispc.txt ?");
- }
- if (ch == '4') {
- fprintf(tmp, "4 - PCElm problem.\n");
- ask(tmp, "Which version of PCElm are you using ?");
- ask(tmp, "What operating system (e.g. MS-DOS 5.0) ?");
- ask(tmp, "Are you running directly from DOS or from a multitasker (e.g. Windows\nor DESQview) ?");
- ask(tmp, "How much memory is free at the command.com prompt ?");
- }
-
- /* append the signature if there is one */
- strcpy(sig_fn, my_stuff.home);
- strcat(sig_fn, my_stuff.signature);
- if ((sig = fopen(sig_fn, "rt")) != NULL) {
- fprintf(tmp, "\n-- \n");
- while(fgets(buf, 79, sig) != NULL)
- fputs(buf, tmp);
- }
- fclose(sig);
-
- fclose(tmp);
-
- clreos();
- printf("\nYour answers have been recorded in a mail file. Please comfirm\n");
- printf("that you wish to send this file to the support team at DEMON.\n\n");
- printf("Send bug report (y/n) ? ");
- do
- {
- ans = getch();
- ans = toupper(ans);
- }
- while ((ans != 'Y') && (ans != 'N'));
- putch(ans);
- if (ans != 'Y')
- unlink("reply.tmp");
- else {
- wrk = parse("reply.tmp", TRUE);
- if (wrk == NULL) {
- unlink("reply.tmp");
- return;
- }
- pass_to_smtp("reply.tmp", wrk, TRUE);
- printf("\n\nYour bug report will be mailed to the Support Team next time you\n");
- printf("successfully connect to DEMON. Press any key to return to Snews. ");
- ans = getch();
- }
- }
-
- /*------------------------ Clear lower half of screen ---------------------*/
- void clreos()
- {
- int i;
-
- for (i=0;i<14;i++) {
- gotoxy(1, i+12);
- clreol();
- }
- gotoxy(1, 12);
- }
-
- /*------------------- Ask a question and record the answer ----------------*/
- void ask(FILE *tmp, char *question)
- {
- char buf[512];
- int i;
-
- printf("%s\n", question);
- fprintf(tmp, "Q. %s\n", question);
- i = 12;
-
- do
- {
- gets(buf);
- putch('\n');
- fputs(buf, tmp);
- fputs("\n", tmp);
- if (++i > 23) {
- i--;
- gotoxy(1, 13);
- delline();
- gotoxy(1, i);
- }
- }
- while (strlen(buf) > 0);
- clreos();
- }
-
- /*------------------- Ask a question and return the answer ---------------*/
- char answer(char *question, char *set)
- {
- int ch, i;
-
-
- printf("%s", question);
- putch(' ');
- do
- {
- ch = getch();
- ch = toupper(ch);
- for (i=0;i<(int)strlen(set);i++) {
- if (ch == toupper(set[i])) {
- clreos();
- return (char)ch;
- }
- }
- }
- while (1==1);
- }
-